﻿
@using TomNet.IMSC.Web.Areas.Finance.Controllers;
@using TomNet.IMSC.Web.Areas.Finance.Models;
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">
    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .ibox {
            margin-bottom: 0px;
        }

        .ibox-content {
            padding: 15px 20px 0px 20px;
        }

        .label-control {
            font-weight: 700;
            cursor: default;
            width: 60px;
            text-align: center;
            display: inline;
            float: left;
            line-height: 32px;
        }

        .input-group {
            float: left;
            width: 180px;
        }

        .select-control {
            float: left;
            width: 180px;
            padding-left: 15px;
            padding-right: 15px;
        }

        .input-group {
            padding-left: 15px;
            padding-right: 15px;
        }

        .select-control .select-min {
            width: 50%;
            float: left;
        }


        form .row {
            margin-bottom: 8px;
            width: 100%;
        }
    </style>
    <link href="~/Content/Css/plugins/chosen/chosen.css" rel="stylesheet" />
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>商贷流水</h5>
            </div>



            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">

                        <form id="mainForm">
                            @*<input id="repeatPhone" name="repeatPhone" type="hidden" value="false">*@
                            <div class="row">
                                <div class="col-sm-12">
                                    <label class="label-control">运行状态</label>
                                    <div class="select-control">
                                        <select class="form-control" id="runningState" name="runningState">
                                            <option value="0">全部</option>
                                            <option value="1">正常</option>
                                            <option value="2">异常</option>
                                            <option value="3">终止</option>
                                        </select>

                                    </div>
                                    <label class="label-control">进度状态</label>
                                    <div class="select-control">
                                        <select class="form-control" id="progressState" name="progressState">
                                            <option value="-1">全部</option>
                                            @foreach (int item in Enum.GetValues(typeof(Progress_State)))
                                            {
                                                <option value='@item'>@Enum.Parse(typeof(Progress_State), item.ToString()).ToString()</option>
                                            }

                                        </select>

                                    </div>


                                    @*<label class="label-control">门店佣金</label>
                                        <div class="input-group">
                                            <select data-placeholder="门店佣金" class="chosen-select" multiple="" style="width: 460px;" tabindex="-1">
                                                <option value="1" hassubinfo="true" selected>待确认</option>
                                                <option value="2" hassubinfo="true" selected>待审核</option>
                                                <option value="3" hassubinfo="true" selected>待结算</option>

                                                <option value="4" hassubinfo="true">已结算</option>
                                                <option value="5" hassubinfo="true">已结清</option>
                                                <option value="6" hassubinfo="true">待退款</option>

                                            </select>
                                        </div>*@


                                    <label class="label-control">起始日期</label>
                                    <div class="select-control">
                                        <input type="text" class="form-control" id="beginDate" name="beginDate" readonly="readonly" value="@( DateTime.Now.ToString("yyyy-MM-01") )">
                                    </div>
                                    <label class="label-control">结束日期</label>
                                    <div class="select-control">
                                        <input type="text" class="form-control" id="endDate" name="endDate" readonly="readonly" value="@ClassHelper.LastDayOfMonth(DateTime.Now).ToString("yyyy-MM-dd")">
                                    </div>

                                    <input type="hidden" id="last7" name="last7" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")+":"+DateTime.Now.ToString("yyyy-MM-dd"))" />
                                    <input type="hidden" id="lastMonth" name="lastMonth" value="@(ClassHelper.FirstDayOfPreviousMonth(DateTime.Now).ToString("yyyy-MM-dd")+":"+ClassHelper.LastDayOfPrdviousMonth(DateTime.Now).ToString("yyyy-MM-dd"))" />
                                    <input type="hidden" id="thisMonth" name="thisMonth" value="@(DateTime.Now.ToString("yyyy-MM-01")+":"+ClassHelper.LastDayOfMonth(DateTime.Now).ToString("yyyy-MM-dd"))" />
                                    <button name="btn-search" class="btn-primary btn btn-sm" type="button" data-content="1" style="vertical-align:middle;">
                                        <i class="fa fa-search"></i>&nbsp;&nbsp;<span class="bold">近7天</span>
                                    </button>
                                    <button name="btn-search" class="btn-primary btn btn-sm" type="button" data-content="2" style="vertical-align:middle;">
                                        <i class="fa fa-search"></i>&nbsp;&nbsp;<span class="bold">上个月</span>
                                    </button>
                                    <button name="btn-search" class="btn-primary btn btn-sm" type="button" data-content="3" style="vertical-align:middle;">
                                        <i class="fa fa-search"></i>&nbsp;&nbsp;<span class="bold">本月</span>
                                    </button>
                                </div>
                            </div>

                            <div class="col-sm-11" style="margin-left: -30px;margin-bottom: -80px;">
                                <div class="col-sm-11">
                                    <label class="label-control">进　　度</label>
                                    <div class="select-control">
                                        <select class="form-control" id="progress" name="progress">
                                            <option value="0">全部</option>
                                            @foreach (int item in Enum.GetValues(typeof(ProgressStr)))
                                            {
                                                <option value='@item'>@Enum.Parse(typeof(ProgressStr), item.ToString()).ToString()</option>
                                            }
                                        </select>
                                    </div>

                                    <label class="label-control">搜索类别</label>
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="false">
                                                全部 <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu wid">
                                                <li>
                                                    <a href="javascript:void(0);" id="typeA" class="font-bold" onclick="attButton(this,'','')">全部</a>
                                                </li>
                                                <li class="divider"></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-1','cName')">客户姓名</a></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-2','cPhone')">客户电话</a></li>
                                                <li class="divider"></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-3','iName')">门店名称</a></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-4','uName')">经纪人姓名</a></li>
                                                <li class="divider"></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-5','sName')">收件姓名</a></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-6','tName')">办件人姓名</a></li>

                                                <li class="divider"></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-7','sType')">服务类型</a></li>
                                                <li><a href="javascript:void(0);" onclick="attButton(this,'-8','rId')">流水号</a></li>
                                            </ul>
                                        </div>
                                        <input type="hidden" id="keyLimit" name="keyLimit" value="" />
                                        <input type="hidden" id="pageSize" name="pageSize" value="" />
                                        <input type="hidden" id="pageIndex" name="pageIndex" value="" />
                                        <input type="text" class="form-control" id="searchLimit" name="searchLimit" style="width: 325px;">
                                    </div>


                                    <div class="input-group" style="display:none;">
                                        <label class="label-control">关&nbsp; 键&nbsp;&nbsp;字</label>
                                        <input type="hidden" class="form-control searchKey" id="searcgKey" name="searcgKey">
                                    </div>
                                    <div class="btn-group">

                                        <button id="btn-search-all" class="btn-primary btn" type="button" style="vertical-align:middle;">
                                            <i class="fa fa-search"></i>&nbsp;&nbsp;<span class="bold">查询</span>
                                        </button>
                                        <button class="btn btn-primary m-l" type="reset" onclick="resetAll()">清空</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <table id="table" data-mobile-responsive="true"></table>

            </div>
        </div>
        @* 用来传递消息的隐藏域 *@
        <input id="handle_status" value="" hidden="hidden">
    </div>




    @*<script src="~/Scripts/plugins/intro/intro.js"></script>*@

    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>
    <!-- 自定义js -->
    <script type="text/javascript" src="~/Scripts/content.js?v=1.0.0"></script>
    <!-- Bootstrap table -->
    <script type="text/javascript" src="~/Scripts/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>
    @*<script src="~/Scripts/plugins/layer/layer.min.js"></script>*@
    @*<script src="~/Areas/Finance/Scripts/running.js"></script>*@

    <script src="~/Scripts/loginmodel.js?a=@(DateTime.Now.Ticks)"></script>
    <script src="~/Areas/Finance/Scripts/businessloan.js?a=@(DateTime.Now.Ticks)"></script>
    <script src="~/Scripts/plugins/layer/laydate/laydate.js"></script>
    <script src="~/Scripts/plugins/chosen/chosen.jquery.js"></script>
    <script src="~/Scripts/jquery.linq.min.js"></script>
    <script>

        var config = {
            '.chosen-select': {},
            '.chosen-select-deselect': {
                allow_single_deselect: true
            },
            '.chosen-select-no-single': {
                disable_search_threshold: 10
            },
            '.chosen-select-no-results': {
                no_results_text: 'Oops, nothing found!'
            },
            '.chosen-select-width': {
                width: "95%"
            }
        }
        for (var selector in config) {
            $(selector).chosen(config[selector]);
        }

        function attButton1(self, str) {

            var tar = $(self).parent().parent().prev();
            tar.text("查询 " + str + " ");//+escape('')
            $('<span class="caret"></span>').appendTo(tar);

            var tds = $(self).parent().parent();
            $.each(tds, function (val, objs) {
                $(this).find("a[href='javascript:void(0);']").removeClass("font-bold");
            });
            $(self).addClass("font-bold");

            $table.bootstrapTable('refresh');
            return false;


        }
        function resetAll() {
            attButton($('#typeA'), '', '');
        }

        function attButton(self, str, type) {
            var tar = $(self).parent().parent().prev();
            $('#keyLimit').val(type);
            console.log($(self).text());
            tar.text($(self).text() + " ");//"查询 " + str + " ");//+escape('')
            $('<span class="caret"></span>').appendTo(tar);

            var tds = $(self).parent().parent();
            $.each(tds, function (val, objs) {
                $(this).find("a[href='javascript:void(0);']").removeClass("font-bold");
            });
            $(self).addClass("font-bold");
        }


        $(function () {
            laydate({
                elem: '#beginDate',
                format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
                festival: true, //显示节日
                min: '2010-01-01 00:00:00', //设定最小日期为当前日期
                issure: false,
                istoday: true,
                isclear: false,
                choose: function (datas) { //选择日期完毕的回调
                    //alert('得到：' + datas);
                }
            });
            laydate({
                elem: '#endDate',
                start: laydate.now(),
                format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
                festival: true, //显示节日
                issure: false,
                istoday: true,
                isclear: false,
                min: '2010-01-01 00:00:00', //设定最小日期为当前日期
                choose: function (datas) { //选择日期完毕的回调
                    //alert('得到：' + datas);
                }
            });
        });
    </script>
</body>
</html>
